package com.crane.oss.school.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.crane.common.core.utils.CollectionUtil;
import com.crane.oss.api.bean.resp.ClassInfoResp;
import com.crane.oss.enums.*;
import com.crane.oss.school.dao.*;
import com.crane.oss.school.model.*;
import com.crane.oss.school.syn.SynXunfeiService;
import com.crane.oss.sports.XunFeiPushEventApiService;
import com.crane.oss.sys.dao.PartyDao;
import com.crane.oss.sys.model.Party;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.crane.common.core.exception.AppException;
import com.crane.common.core.exception.BasicErrorCode;
import com.crane.common.core.exception.SysException;
import com.crane.common.core.utils.StringUtil;
import com.crane.common.framework.utils.BeanUtil;
import com.crane.oss.app.bean.req.AppBindingStudentReq;
import com.crane.oss.app.bean.resp.AppStudentInfo;
import com.crane.oss.school.bean.request.QueryClassesInfoReq;
import com.crane.oss.school.bean.request.QueryClassesReq;
import com.crane.oss.school.bean.request.QueryTeacherReq;
import com.crane.oss.school.bean.request.classesinfo.AddClassesInfoReq;
import com.crane.oss.school.bean.request.classesinfo.BatchDeleteClassesInfoReq;
import com.crane.oss.school.bean.request.classesinfo.BatchImportClassesEntity;
import com.crane.oss.school.bean.request.classesinfo.UpdateClassesInfoReq;
import com.crane.oss.school.bean.resp.ClassTeacherResp;
import com.crane.oss.school.bean.resp.ClassesInfoExportResp;
import com.crane.oss.school.bean.resp.ClassesInfoResp;
import com.crane.oss.school.bean.resp.ClassesInfoResp.TeacherInfo;
import com.crane.oss.school.bean.resp.ClassesInfoWebDto;
import com.crane.oss.school.bean.resp.TeacherClassResp;
import com.crane.oss.school.bean.resp.TeacherResp;
import com.crane.oss.school.service.ClassesInfoService;
import com.crane.oss.school.service.TeacherClassService;
import com.crane.oss.school.service.TeacherService;
import com.crane.oss.sys.bean.resp.PartyBean;
import com.crane.oss.sys.service.PartyService;

import lombok.extern.slf4j.Slf4j;

/**
 * @author zhenxing.pi
 * @email ccsu123456@qq.com
 * @date 2022年03月26日 14时38分15秒
 */
@Service
@Slf4j
public class ClassesInfoServiceImpl implements ClassesInfoService {

	@Resource
	protected ClassesInfoDao classesInfoDao;

	@Resource
	protected TeacherClassDao teacherClassDao;

	@Autowired
	protected TeacherClassService teacherClassService;

	@Resource
	protected StudentClassDao studnetClassDao;

	@Resource
	protected TeacherDao teacherDao;

	@Resource
	protected PartyDao partyDao;

	@Resource
	StudentDao studentDao;

	@Resource
	PartyService partyService;

 	@Autowired
	TeacherService teacherService;

	@Resource
	SynXunfeiService synXunfeiService;

	@Override
	public ClassesInfoResp queryClassesInfo(Long classId) {
		log.info("ClassesInfoServiceImpl queryClassesInfo classId={}", classId);
		ClassesInfo classesInfo = classesInfoDao.selectById(classId);
		if (null == classesInfo) {
			throw new AppException(BasicErrorCode.ENTITY_NOT_EXISTS, "班级");
		}
		ClassesInfoResp classesInfoResp = new ClassesInfoResp();
		BeanUtil.copyProperties(classesInfo, classesInfoResp);

		classesInfoResp.setTypeName(ClassesTypeEnum.getRemark(classesInfo.getType()));
		classesInfoResp.setSectionName(SectionEnum.getRemarkByType(classesInfo.getSection()));
		classesInfoResp.setGradeName(GradeEnum.getGradeEnum(classesInfo.getGrade()));

		PartyBean partyBean=partyService.queryParty(classesInfo.getPartyId());
		if(null != partyBean){
			classesInfoResp.setSchoolName(partyBean.getNameCn());
		}

		QueryTeacherReq query = new QueryTeacherReq();
		query.setClassId(classId);
		query.setPartyId(classesInfo.getPartyId());
		query.setPageSize(5000);
		IPage<TeacherResp> page = teacherService.queryTeacherList(query);
		List<TeacherInfo> tList = new ArrayList<TeacherInfo>();
		for (TeacherResp temp : page.getRecords()) {
			ClassesInfoResp resp = new ClassesInfoResp();
			TeacherInfo info = resp.new TeacherInfo();
			BeanUtil.copyProperties(temp, info);
			tList.add(info);
		}
		classesInfoResp.setTeacherList(tList);

		return classesInfoResp;
	}

	@Override
	public List<ClassesInfoExportResp> queryExportList(QueryClassesInfoReq request) {
		log.info("ClassesInfoServiceImpl queryExportList queryRequest={}", request);
		IPage<ClassesInfoResp> queryList = this.queryList(request);
		List<ClassesInfoExportResp> returnList = BeanUtil.copyList(queryList.getRecords(), ClassesInfoExportResp.class);
		return returnList;
	}

	@Override
	public IPage<ClassesInfoResp> queryList(QueryClassesInfoReq queryRequest) {
		log.info("ClassesInfoServiceImpl queryList queryRequest={}", queryRequest);
		Map<String, Object> map = BeanUtil.asMap(queryRequest);
		map.put("offset", queryRequest.getPageSize() * (queryRequest.getPageNo() - 1));
		map.put("limit", queryRequest.getPageSize());
		int total = classesInfoDao.queryListTotal(map);

		IPage<ClassesInfoResp> result = new Page<>();
		result.setCurrent(queryRequest.getPageNo());
		result.setPages(queryRequest.getPageSize());
		List<ClassesInfoResp> resultList = new ArrayList<>();
		result.setRecords(resultList);
		result.setTotal(total);
		if (total == 0) {
			return result;
		}

		List<ClassesInfoWebDto> queryList = classesInfoDao.queryList(map);

		for (ClassesInfoWebDto queryResp : queryList) {
			ClassesInfoResp resultResp = new ClassesInfoResp();
			BeanUtil.copyProperties(queryResp, resultResp);

			resultResp.setSectionName(SectionEnum.getRemarkByType(queryResp.getSection()));
			resultResp.setGradeName(GradeEnum.getGradeEnum(queryResp.getGrade()));
			resultResp.setTypeName(ClassesTypeEnum.getRemark(queryResp.getType()));
			resultResp.setStatusName(ClassesStatusEnum.getRemark(queryResp.getStatus()));

			resultList.add(resultResp);
		}

		result.setRecords(resultList);
		return result;
	}

	@Override
	public boolean queryClassNameExists(String className, Long partyId) {
		log.info("ClassesInfoServiceImpl save className={},partyId={}", className, partyId);
		ClassesInfo queryClassesInfo = classesInfoDao.selectOne(Wrappers.lambdaQuery(ClassesInfo.class)
				.eq(ClassesInfo::getClassName, className).eq(ClassesInfo::getPartyId, partyId));
		if (null != queryClassesInfo) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void batchSave(List<BatchImportClassesEntity> entityList, Long partyId, Long createUserId, Long schoolId) {
		log.info("ClassesInfoServiceImpl save partyId={}, schoolId={}, section={}, grade={}", partyId, schoolId);
		for (BatchImportClassesEntity entity : entityList) {
			AddClassesInfoReq addRequest = new AddClassesInfoReq();
			addRequest.setPartyId(partyId);
			addRequest.setSchoolId(schoolId);
			addRequest.setClassName(entity.getClassName());
			addRequest.setSection(entity.getSection());
			addRequest.setGrade(entity.getGrade());
			addRequest.setTermBeginTime(entity.getTermBeginTime());
			addRequest.setType(entity.getType());
			addRequest.setCreateUserId(createUserId);
			this.save(addRequest);
		}

	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void updateClassGrade() {
		List<Party> partyList=partyDao.getStartSchool();
		for(Party party : partyList){
			String schoolPeriods=party.getSchoolPeriod();
			if(StringUtil.isNotEmpty(schoolPeriods)){
				boolean mini= schoolPeriods.contains(SectionEnum.PRIMARY_SCHOOL.getType().toString());
				boolean mid= schoolPeriods.contains(SectionEnum.JUNIOR_HIGH_SCHOOL.getType().toString());
				boolean hight= schoolPeriods.contains(SectionEnum.HIGH_SCHOOL.getType().toString());
                //查询所有班级
				LambdaQueryWrapper<ClassesInfo> queryWrapper = new LambdaQueryWrapper<>();
				queryWrapper.eq(ClassesInfo::getPartyId, party.getPartyId());
				queryWrapper.eq(ClassesInfo::getStatus, 1);
				List<ClassesInfo> classesInfoList = classesInfoDao.selectList(queryWrapper);
			    if(CollectionUtil.isNotEmpty(classesInfoList)){
			    	for(ClassesInfo classesInfo : classesInfoList){
			    		  if(classesInfo.getGrade() < 6){
							  classesInfo.setGrade(classesInfo.getGrade()+1);
						  }else if(classesInfo.getGrade() == 6 && mid){
							  classesInfo.setGrade(1);
							  classesInfo.setSection(SectionEnum.JUNIOR_HIGH_SCHOOL.getType());
						  }else if(classesInfo.getGrade() > 6 && classesInfo.getGrade() < 9){
							  classesInfo.setGrade(classesInfo.getGrade()+1);
						  }else if(classesInfo.getGrade() == 9 && hight){
							  classesInfo.setGrade(1);
							  classesInfo.setSection(SectionEnum.HIGH_SCHOOL.getType());
						  }else if(classesInfo.getGrade() > 9){
							  classesInfo.setGrade(classesInfo.getGrade()+1);
						  }
						classesInfo.setUpdateTime(new Date());
						classesInfoDao.updateById(classesInfo);
					}
				}
			}
		}
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void updateClassOver() {
		List<Party> partyList=partyDao.getEndSchool();
		for(Party party : partyList){
			String schoolPeriods=party.getSchoolPeriod();
			if(StringUtil.isNotEmpty(schoolPeriods)){
				boolean mini= schoolPeriods.contains(SectionEnum.PRIMARY_SCHOOL.getType().toString());
				boolean mid= schoolPeriods.contains(SectionEnum.JUNIOR_HIGH_SCHOOL.getType().toString());
				boolean hight= schoolPeriods.contains(SectionEnum.HIGH_SCHOOL.getType().toString());
				//查询所有班级
				LambdaQueryWrapper<ClassesInfo> queryWrapper = new LambdaQueryWrapper<>();
				queryWrapper.eq(ClassesInfo::getPartyId, party.getPartyId());
				queryWrapper.eq(ClassesInfo::getStatus, 1);
				List<ClassesInfo> classesInfoList = classesInfoDao.selectList(queryWrapper);
				if(CollectionUtil.isNotEmpty(classesInfoList)){
					for(ClassesInfo classesInfo : classesInfoList){
						boolean end=(classesInfo.getGrade() == 6 && !mid) ||
								(classesInfo.getGrade() == 9 && !hight) ||
								classesInfo.getGrade() == 12;
				        if(end){
							classesInfo.setStatus(0);
							classesInfo.setUpdateTime(new Date());
							classesInfoDao.updateById(classesInfo);
							studentDao.updateAllStudentOver(classesInfo.getClassId());
						}
					}
				}
			}
		}
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public int save(AddClassesInfoReq addRequest) {
		log.info("ClassesInfoServiceImpl save request={}", addRequest);

		String className = addRequest.getClassName();
		if (queryClassNameExists(className, addRequest.getPartyId())) {
			throw new AppException(BasicErrorCode.ENTITY_IS_EXISTS, "班级名称");
		}

		ClassesInfo newClassesInfo = new ClassesInfo();
		BeanUtil.copyProperties(addRequest, newClassesInfo);
		int i = 0;
		try {
			Date date = new Date();
			newClassesInfo.setSection(Integer.valueOf(addRequest.getSection()));
			newClassesInfo.setCreateTime(date);
			i = classesInfoDao.insert(newClassesInfo);


			ClassInfoResp classInfoResp = buildSynClassInfo(newClassesInfo);
			synXunfeiService.pushDate(classInfoResp, XunFeiPushEventApiService.EVENT_GRADE_CLASS,XunFeiPushEventApiService.INSERT,newClassesInfo.getPartyId().toString(),newClassesInfo.getCreateUserId().toString());

			if (null != addRequest.getTeacherIds()) {
				for (Long teacherId : addRequest.getTeacherIds()) {
					TeacherClass teacherClass = new TeacherClass();
					teacherClass.setTeacherId(teacherId);
					teacherClass.setClassId(newClassesInfo.getClassId());
					teacherClass.setCreateTime(date);
					teacherClass.setCreateUserId(addRequest.getCreateUserId());
					teacherClassDao.insert(teacherClass);
				}
			}
		} catch (Exception e) {
			log.info("ClassesInfoServiceImpl save e={}", e);
			throw new SysException();
		}
		return i;
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public int update(UpdateClassesInfoReq updateRequest) {
		log.info("ClassesInfoServiceImpl update request={}", updateRequest);
		ClassesInfo dbClassInfo= classesInfoDao.selectById(updateRequest.getClassId());
		ClassesInfo classesInfo = new ClassesInfo();
		BeanUtil.copyProperties(updateRequest, classesInfo);
		int i = 0;
		try {
			Date date = new Date();
			classesInfo.setUpdateTime(date);
			i = classesInfoDao.updateById(classesInfo);

			ClassInfoResp classInfoResp=new ClassInfoResp();
			classInfoResp.setId(dbClassInfo.getClassId().toString());
			classInfoResp.setName(classesInfo.getClassName());
			classInfoResp.setPhase(SectionEnum.getAlias(classesInfo.getSection()));
			classInfoResp.setGrade(classesInfo.getGrade().toString());
			Integer xdGrade = classesInfo.getGrade();
			if(xdGrade> 6 && xdGrade<=9){
				xdGrade =xdGrade -6;
			}else if(xdGrade> 9){
				xdGrade =xdGrade -9;
			}
			classInfoResp.setXdGrade(xdGrade.toString());
			classInfoResp.setType(classesInfo.getType().toString());
			classInfoResp.setCampusId(classesInfo.getSchoolId().toString());
			synXunfeiService.pushDate(classInfoResp, XunFeiPushEventApiService.EVENT_GRADE_CLASS,XunFeiPushEventApiService.UPDATE,dbClassInfo.getPartyId().toString(),dbClassInfo.getCreateUserId().toString());


			if (null != updateRequest.getTeacherIds()) {
				List<TeacherClassResp> queryTeacherClassList = this.teacherClassService
						.queryListByClassId(updateRequest.getClassId());
				for (TeacherClassResp teacherClass : queryTeacherClassList) {
					TeacherClass updateTeacherClass = new TeacherClass();
					updateTeacherClass.setId(teacherClass.getId());
					updateTeacherClass.setUpdateTime(date);
					updateTeacherClass.setUpdateUserId(updateRequest.getUpdateUserId());
					updateTeacherClass.setDelFlag(DelFlagEnum.YES.getType());
					teacherClassDao.updateById(updateTeacherClass);
				}
				for (Long teacherId : updateRequest.getTeacherIds()) {
					TeacherClass newTeacherClass = new TeacherClass();
					newTeacherClass.setTeacherId(teacherId);
					newTeacherClass.setClassId(classesInfo.getClassId());
					newTeacherClass.setCreateTime(date);
					newTeacherClass.setCreateUserId(updateRequest.getUpdateUserId());
					teacherClassDao.insert(newTeacherClass);
				}
			}
		} catch (Exception e) {
			log.info("ClassesInfoServiceImpl update e={}", e);
			throw new SysException();
		}
		return i;
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void batchDelete(BatchDeleteClassesInfoReq request) {
		log.info("ClassesInfoServiceImpl batchDelete request={}", request);
		Date now = new Date();
		try {
			for (Long classId : request.getClassIds()) {
				ClassesInfo classesInfo = classesInfoDao.selectById(classId);
				if (null != classesInfo) {
					List<TeacherClassResp> queryTeacherClassList = this.teacherClassService.queryListByClassId(classId);
					List<StudentClass> queryStudentClassList = studnetClassDao.selectList(Wrappers.lambdaQuery(StudentClass.class)
							.eq(StudentClass::getClassId, classId).eq(StudentClass::getDelFlag, DelFlagEnum.NO.getType()));
					if (queryTeacherClassList.size() == 0 && queryStudentClassList.size() == 0) {
						classesInfo.setUpdateTime(now);
						classesInfo.setUpdateUserId(request.getUpdateUserId());
						classesInfo.setDelFlag(DelFlagEnum.YES.getType());
						classesInfoDao.updateById(classesInfo);

						ClassInfoResp classInfoResp = buildSynClassInfo(classesInfo);
						synXunfeiService.pushDate(classInfoResp, XunFeiPushEventApiService.EVENT_GRADE_CLASS,XunFeiPushEventApiService.DELETE,classesInfo.getPartyId().toString(),classesInfo.getCreateUserId().toString());

					}
				}
			}
		} catch (Exception e) {
			log.info("ClassesInfoServiceImpl batchDelete e={}", e);
			throw new SysException();
		}
	}

	private ClassInfoResp buildSynClassInfo(ClassesInfo classesInfo) {
		ClassInfoResp classInfoResp=new ClassInfoResp();
		classInfoResp.setId(classesInfo.getClassId().toString());
		classInfoResp.setName(classesInfo.getClassName());
		classInfoResp.setPhase(SectionEnum.getAlias(classesInfo.getSection()));
		classInfoResp.setGrade(classesInfo.getGrade().toString());
		Integer xdGrade = classesInfo.getGrade();
		if(xdGrade> 6 && xdGrade<=9){
			xdGrade =xdGrade -6;
		}else if(xdGrade> 9){
			xdGrade =xdGrade -9;
		}
		classInfoResp.setXdGrade(xdGrade.toString());
		classInfoResp.setType(classesInfo.getType().toString());
		classInfoResp.setCampusId(classesInfo.getSchoolId().toString());
		return classInfoResp;
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public int delete(Long classId) {
		log.info("ClassesInfoServiceImpl delete classId={}", classId);
		ClassesInfo classesInfo = classesInfoDao.selectById(classId);
		if (null == classesInfo) {
			throw new AppException(BasicErrorCode.ENTITY_NOT_EXISTS, "班级");
		}

		List<TeacherClassResp> queryTeacherClassList = this.teacherClassService.queryListByClassId(classId);
		if (queryTeacherClassList.size() > 0) {
			throw new AppException(BasicErrorCode.DEFINED_MSG, "当前班级还存在任课老师");
		}

		List<StudentClass> queryStudentClassList = studnetClassDao.selectList(Wrappers.lambdaQuery(StudentClass.class)
				.eq(StudentClass::getClassId, classId).eq(StudentClass::getDelFlag, DelFlagEnum.NO.getType()));
		if (queryStudentClassList.size() > 0) {
			throw new AppException(BasicErrorCode.DEFINED_MSG, "当前班级还存在在读学生");
		}

		int i = 0;
		try {
			classesInfo.setUpdateTime(new Date());
			classesInfo.setDelFlag(DelFlagEnum.YES.getType());
			i = classesInfoDao.updateById(classesInfo);

			ClassInfoResp classInfoResp = buildSynClassInfo(classesInfo);
			synXunfeiService.pushDate(classInfoResp, XunFeiPushEventApiService.EVENT_GRADE_CLASS,XunFeiPushEventApiService.DELETE,classesInfo.getPartyId().toString(),classesInfo.getCreateUserId().toString());


		} catch (Exception e) {
			log.info("ClassesInfoServiceImpl delete e={}", e);
			throw new SysException();
		}
		return i;
	}

	@Override
	public ClassTeacherResp queryClassesTeacher(Long classId) {
		log.info("ClassesInfoServiceImpl queryClassesTeacher classId={}", classId);
		ClassesInfo classesInfo = classesInfoDao.selectById(classId);
		if (null == classesInfo) {
			throw new AppException(BasicErrorCode.ENTITY_NOT_EXISTS, "班级");
		}

		String teacherNames = null;
		List<Teacher> teacherList = this.teacherDao.queryTeacherForClasses(classId);
		for (Teacher teacher : teacherList) {
			if (StringUtil.isNotEmpty(teacherNames)) {
				teacherNames = teacherNames + "," + teacher.getName();
			} else {
				teacherNames = teacher.getName();
			}
		}

		ClassTeacherResp resp = new ClassTeacherResp();
		resp.setClassName(classesInfo.getClassName());
		resp.setTeacherNames(teacherNames);
		return resp;
	}

	@Override
	public List<ClassesInfoResp> queryNotExistsClasses(Long teacherId, Long partyId) {
		log.info("ClassesInfoServiceImpl queryNotExistsClasses teacherId={},partyId={}", teacherId, partyId);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("partyId", partyId);
		map.put("teacherId", teacherId);
		List<ClassesInfo> queryList = classesInfoDao.queryNotExistsClasses(map);
		List<ClassesInfoResp> returnList = BeanUtil.copyList(queryList, ClassesInfoResp.class);
		return returnList;
	}

	@Override
	public List<Map<String, Object>> queryClassesForDropDown(QueryClassesReq request) {
		log.info("ClassesInfoServiceImpl queryClassesForDropDown request={}", request);
		LambdaQueryWrapper<ClassesInfo> queryClassesInfoWrapper = new LambdaQueryWrapper<>();
		queryClassesInfoWrapper.eq(ClassesInfo::getPartyId, request.getPartyId());
		queryClassesInfoWrapper.eq(ClassesInfo::getDelFlag, DelFlagEnum.NO.getType());
		if (StringUtil.isNotBlank(request.getGrade())) {
			queryClassesInfoWrapper.eq(ClassesInfo::getGrade, Integer.valueOf(request.getGrade()));
		}
		if (StringUtil.isNotBlank(request.getClassType())) {
			queryClassesInfoWrapper.eq(ClassesInfo::getType, Integer.valueOf(request.getClassType()));
		}
		if (null != request.getSchoolId() && 0 != request.getSchoolId()) {
			queryClassesInfoWrapper.eq(ClassesInfo::getSchoolId, request.getSchoolId());
		}
		queryClassesInfoWrapper.orderByDesc(ClassesInfo::getCreateTime);

		List<ClassesInfo> queryList = classesInfoDao.selectList(queryClassesInfoWrapper);

		List<Map<String, Object>> list = new ArrayList<>();

		for (ClassesInfo classes : queryList) {
			Map<String, Object> map = new HashMap<>();
			map.put("key", classes.getClassId());
			map.put("name", classes.getClassName());
			list.add(map);
		}
		return list;
	}

	@Override
	public List<ClassesInfoResp> queryClassesForStudent(Long studentId) {
		log.info("ClassesInfoServiceImpl queryClassesForStudent studentId={}", studentId);
		List<ClassesInfo> queryList = classesInfoDao.queryClassesForStudent(studentId,1);
		List<ClassesInfoResp> returnList = BeanUtil.copyList(queryList, ClassesInfoResp.class);
		return returnList;
	}

	@Override
	public List<ClassesInfoResp> queryClassesForSchoolId(Long schoolId) {
		List<ClassesInfo> list = this.classesInfoDao.selectList(Wrappers.lambdaQuery(ClassesInfo.class)
				.eq(ClassesInfo::getSchoolId, schoolId));
		List<ClassesInfoResp> returnList = BeanUtil.copyList(list, ClassesInfoResp.class);
		return returnList;
	}

	@Override
	public List<AppStudentInfo> bindingStudent(AppBindingStudentReq appBindingStudentReq) {
		List<AppStudentInfo> list =classesInfoDao.bindingStudent(appBindingStudentReq);
		return list;
	}

}
